package cn.wolfcode.controller;

import cn.wolfcode.domain.Result;
import cn.wolfcode.util.OssUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class UpLoadController {
    @Autowired
    private OssUtils ossUtils;

    @PostMapping("/upload")
    public Result upload(MultipartFile image) throws Exception {
        String upLoad = ossUtils.upLoad(image);
        return Result.success(upLoad);

    }
}
